package com.molichuxing.gateway.bff.order.services;

import com.molichuxing.framework.dto.Paged;
import com.molichuxing.framework.exception.BizException;
import com.molichuxing.framework.service.RootService;
import com.molichuxing.gateway.bff.order.entity.request.create.PaymentOfflineCreateVo;
import com.molichuxing.gateway.bff.order.entity.response.*;
import com.molichuxing.services.property.OfflineRepayTypeEnum;

import java.util.List;
import java.util.Map;

/**
 * @Author: renzhengyu
 * @Description:
 * @Date: Created in 9:52 2019/9/10
 * @Modified By:
 **/
public interface OrderScheduleBffService  extends RootService {


    /**
     * 采购详情还款信息
     * @param orderCode
     * @return
     */
    List<OrderDealerDetailScheduleVo> orderSchedule(Long orderCode)throws Exception;


    /**
     * 获取经销商订单本期还款列表 - 还款计划
     * @param params
     * @param pageNum
     * @param pageSize
     * @return
     */
    Paged<OrderScheduleCurrentPeriodVo> getOrderScheduleCurrentPeriodList(Map<String, Object> params, Integer pageNum, Integer pageSize) throws Exception;


    /**
     * 获取经销商订单逾期未还款列表 - 逾期未还款
     * @param params
     * @param pageNum
     * @param pageSize
     * @return
     */
    Paged<OrderScheduleOverdueVo> getOrderScheduleOverdueList(Map<String, Object> params, Integer pageNum, Integer pageSize) throws Exception;



    /**
     * 还款计划-基础信息
     * @param orderCode
     * @return
     * @throws Exception
     */
    OrderDealerDetailBasicInfoVo getDetailBasic(Long orderCode)throws Exception;

    /**
     * 还款计划-还款信息
     * @param orderCode
     * @return
     * @throws Exception
     */
    List<OrderDealerDetailScheduleVo> orderSchedulePlan(Long orderCode)throws Exception;

    /**
     * 逾期未还款-逾期信息
     * @param orderCode
     * @return
     * @throws Exception
     */
    List<OrderDealerDetailScheduleVo> orderScheduleExpire(Long orderCode)throws Exception;


    /**
     * 获取线下支付信息
     *
     * @param selectParams
     * @param pageNum
     *            页数
     * @param pageSize
     *            每页条数
     * @return
     * @throws Exception
     */
    public Paged<PaymentOfflineVo> getPaymentOfflinePage(Map<String, Object> selectParams, Integer pageNum, Integer pageSize)
            throws Exception;


    /**
     * 根据线下支付id获取订单排期信息
     *
     * @param offlineId
     *            线下支付id
     * @return
     * @throws Exception
     */
    public PaymentOfflineVo getPaymentOfflineFlow(Integer offlineId) throws Exception;

    /**
     * 获取线下支付订单排期信息
     *
     * @param offlineId
     *            线下支付id
     * @param repayType
     *            线下支付类型
     * @return
     * @throws Exception
     */
    public List<PaymentOfflineScheduleVo> getPaymentOfflineSchedule(Integer offlineId, OfflineRepayTypeEnum repayType)
            throws Exception;

    /**
     * 获取线下支付审核信息
     *
     * @param offlineId
     *            线下支付id
     * @return
     * @throws Exception
     */
    public PaymentOfflineAuditVo getPaymentOfflineAudit(Integer offlineId) throws Exception;

    /**
     * 线下支付流水编号是否存在
     *
     * @param serialNumber
     *            流水编号
     * @return
     */
    public Boolean getSerialNumberExists(String serialNumber) throws IllegalArgumentException, Exception;

    /**
     * 经销商订单所有未还款订单
     * @return
     * @throws Exception
     */
    List<OrderScheduleUnpaidVo> getOrderScheduleUnpaid()throws Exception;

    /**
     * 经销商订单支付未还款排期
     *
     * @param orderCode
     *            订单号
     * @return
     * @throws Exception
     */
    public List<OrderScheduleRelationVo> getOrderScheduleRelationBizDto(Long orderCode) throws Exception;

    /**
     * 订单线下支付新增
     *
     * @param createVo
     *            新增vo
     * @return
     * @throws Exception
     */
    public Boolean createOrderPaymentOffline(PaymentOfflineCreateVo createVo) throws BizException, Exception;

	/**
	 * 分页获取专属里程订单还款计划信息
	 * 
	 * @param params
	 *            orderCode：订单号-long <br />
	 *            userRealName：用户姓名-string <br />
	 *            userPhone：用户手机号-string <br />
	 * @param dealerId
	 *            经销商id
	 * @param pageNum
	 *            页数
	 * @param pageSize
	 *            每页条数
	 * @return
	 * @throws Exception
	 */
	public Paged<OrderRepaymentVo> getExclusivelOrderCurrentPeriod(Map<String, Object> params, Integer dealerId,
			int pageNum, int pageSize) throws Exception;

	/**
	 * 分页获取专属里程订单逾期管理
	 * 
	 * @param params
	 *            orderCode：订单号-long <br />
	 *            userRealName：用户姓名-string <br />
	 *            userPhone：用户手机号-string <br />
	 * @param dealerId
	 *            经销商id
	 * @param pageNum
	 *            页数
	 * @param pageSize
	 *            每页条数
	 * @return
	 * @throws Exception
	 */
	public Paged<OrderOverdueVo> getExclusivelOrderOverdue(Map<String, Object> params, Integer dealerId, int pageNum,
			int pageSize) throws Exception;

	/**
	 * 查询还款计划明细
	 *
	 * @param orderCode 订单号
	 * @param overdue   是否只查询已逾期
	 * @return
	 */
	public List<OrderRepaymentDetailVo> getRepaymentDetail(Long orderCode, boolean overdue);
}
